#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>

int main() {
    int a, b;
    scanf("%d %d", &a, &b);
    int sum = 0;
    int min = 0;
    int max = 0;
    if (a == 0 || b == 0)
        sum = abs(a) - 0 - abs(b) - 0;
    else if(a > 0 && b > 0)
    {
        max = a > b ? a : b;
        sum = max;
    }
    else if (a < 0 && b < 0)
    {
        max = a > b ? b : a;
        sum = abs(max);
    }
    else {
        min = abs(a) >= abs(b) ? abs(b) : abs(a);
        max = abs(a) >= abs(b) ? abs(a) : abs(b);
        sum = min * 2 + max;
    }
    printf("%d", sum);
    return 0;
}